import request from '@/utils/request'
// 查询团队模板列表
export function templateTaskList(query) {
    return request({
      url: '/apqp/base/task/list',
      method: 'get',
      params: query
    })
}
// 获取可绑定评审任务列表
export function reviewTaskList(query) {
  return request({
    url: '/apqp/base/task/reviewTaskList',
    method: 'get',
    params: query
  })
}
// 获取可绑定前置任务列表
export function preTaskList(query) {
  return request({
    url: '/apqp/base/task/preTaskList',
    method: 'get',
    params: query
  })
}
// 任务阶段模板树
export function templatetaskTree(query) {
    return request({
      url: '/apqp/base/tree/taskTree',
      method: 'get',
      params: query
    })
}
// 新增修改阶段树
export function taskTreeSave(data) {
  return request({
    url: '/apqp/base/tree/saveStageTree',
    method: 'post',
    data: data
  })
}
// 新增任务接口
export function addTaskApi(data) {
  return request({
    url: '/apqp/base/task',
    method: 'post',
    data: data
  })
}
// 编辑任务接口
export function editTaskApi(data) {
  return request({
    url: '/apqp/base/task',
    method: 'put',
    data: data
  })
}
// 查询父级任务接口
export function templateTaskTree(query) {
  return request({
    url: '/apqp/base/task/taskTree',
    method: 'get',
    params: query
  })
}
//分页查询模板前置任务列表
export function templateFront(query) {
  return request({
    url: '/apqp/base/task/pre/list',
    method: 'get',
    params: query
  })
}
// 删除前置任务
export function delPreTask(ids) {
  return request({
    url: '/apqp/base/task/pre/deleteByIds',
    method: 'delete',
    params:ids
  })
}
//批量新增前置任务
export function addBatchPreTask(data) {
  return request({
    url: '/apqp/base/task/pre/batchAdd',
    method: 'post',
    data
  })
}
// 修改模板信息
export function updatePreTask(data) {
  return request({
    url: '/apqp/base/task/pre',
    method: 'put',
    data: data
  })
}
//批量新增评审
export function addBatchReview(data) {
  return request({
    url: '/apqp/base/task/review/batchAdd',
    method: 'post',
    data
  })
}
//分页查询模板任务评审列表
export function templateReview(query) {
  return request({
    url: '/apqp/base/task/review/list',
    method: 'get',
    params: query
  })
}
// 删除模板任务评审
export function delRevTask(ids) {
  return request({
    url: '/apqp/base/task/review/deleteByIds',
    method: 'delete',
    params:ids
  })
}
// 业务流程管理分页
export function templateProcessPage(query) {
  return request({
    url: '/activiti/processBusiness/processPage',
    method: 'get',
    params: query
  })
}
// 获取模板任务签核流程
export function getTemplateProcess(query) {
  return request({
    url: '/apqp/base/task/getTemplateProcess',
    method: 'get',
    params: query
  })
}
// 获取仙项目任务签核流程
export function getProjectProcess(query) {
  return request({
    url: '/apqp/project/process/config/list',
    method: 'get',
    params: query
  })
}

// 获取审核意见汇总列表
export function getOperationRecord(processInstanceId) {
  return request({
    url: '/activiti/process/getOperationRecord',
    method: 'get',
    params: {processInstanceId}
  })
}

// 完成审批
export function completTask(data) {
  return request({
    url: '/activiti/process/completTask',
    method: 'post',
    data
  })
}

//审批完成后调用
export function completTaskAfter(data) {
  return request({
    url: '/ny-iqc/news/messageList',
    method: 'post',
    data
  })
}
